/*
Copyright 2009 David Revell

This file is part of SwiFTP.

SwiFTP is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

SwiFTP is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with SwiFTP.  If not, see <http://www.gnu.org/licenses/>.
*/

package lfr.ustc.ftp;

public class CmdTYPE extends CmdManager implements Runnable {
	String input;

	public CmdTYPE(SocketManager sessionThread, String input) {
		super(sessionThread);
		this.input = input;
	}
	public void run() {
		String sendIfo;
		String param = getParameter(input);
		if (param.equals("I") || param.equals("L 8")) {
			sendIfo = "200 Binary ����\r\n";
			sessionThread.transmitType = "BINARY";
		} else if (param.equals("A") || param.equals("A N")) {
			sendIfo = "200 ASCII ����\r\n";
			sessionThread.transmitType = "ASCII";
		} else if (param.equals("E")) {
			sessionThread.transmitType = "ebcdic"; // �����ʲô���ͣ��д����
			sendIfo = "200 EBCDIC ����\r\n";
		} else {
			sendIfo = "530 û�д�����\r\n";
		}
		sessionThread.sendInfo(sendIfo);
	}

}
